//
//  VideoView.m
//  OneDay
//
//  Created by lanou3g on 15/10/27.
//  Copyright © 2015年 oneDay. All rights reserved.
//

#import "VideoView.h"

@implementation VideoView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.bgScrollView = [[UIScrollView alloc] initWithFrame:frame];
        self.bgScrollView.contentSize = CGSizeMake(kWidth * 2, 0);
        self.bgScrollView.pagingEnabled = YES;
        self.bgScrollView.bounces = NO;
        [self addSubview:self.bgScrollView];
        
        self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
        self.tableView.backgroundColor = [UIColor whiteColor];
        [self.bgScrollView addSubview:self.tableView];
        
        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
        [layout setScrollDirection:UICollectionViewScrollDirectionVertical];
        // 尾
        layout.footerReferenceSize = CGSizeMake(0, 40);
        layout.sectionInset = UIEdgeInsetsMake(5, 0, 5, 0);
        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(kWidth, 0, kWidth, kHeight - 64) collectionViewLayout:layout];
        self.collectionView.bounces = NO;
        self.collectionView.backgroundColor = [UIColor whiteColor];
        [self.bgScrollView addSubview:self.collectionView];
    }
    return self;
}

@end
